package com.taiyi.renaissancemall.ui.classification;

import android.content.Context;
import android.util.Log;
import android.view.View;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.taiyi.renaissancemall.R;
import com.taiyi.renaissancemall.bean.NextClassBean;

import java.util.List;

//右边一级
public class NextClassAdapter extends BaseQuickAdapter<NextClassBean.ClassificationlistBeanX, BaseViewHolder> {
    private OnSetClickListener onSetViewClickListener;

    public interface OnSetClickListener {
        void onSetViewClick(View v, int position);
    }

    public void setOnSetViewClickListener(OnSetClickListener listener) {
        this.onSetViewClickListener = listener;
    }

    public NextClassAdapter(int layoutResId, List<NextClassBean.ClassificationlistBeanX> classificationlistBeans) {
        super(layoutResId, classificationlistBeans);
    }

    @Override
    protected void convert(BaseViewHolder viewHoder, NextClassBean.ClassificationlistBeanX item) {

        RecyclerView recyclerView = (RecyclerView) viewHoder.getView(R.id.rcl_next2);
        viewHoder.setText(R.id.title_name, item.name);
        recyclerView.setLayoutManager(new GridLayoutManager(mContext, 3));
        NextClassAdapter2 nextClassAdapter2 = new NextClassAdapter2(R.layout.class_child_child_item_layout, item.classificationlist);
        recyclerView.setAdapter(nextClassAdapter2);
    }

}
